#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QDir>
#include <QFileDialog>
#include <QDebug>
#include <QStringList>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushbutton_openfile_clicked()
{
    QString dir_str = QFileDialog::getExistingDirectory(this, "选择你的文件夹", ".");
    if(dir_str.isEmpty())
    {
        qDebug() << "没有选择文件夹";
    }
    QDir dir(dir_str);

    QStringList list = dir.entryList();
    for(int i = 0; i < list.size(); i++)
        qDebug() << list.at(i);

}

